package com.google.zahra.soap;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import javax.xml.ws.Endpoint;

import org.terracotta.api.ClusteringToolkit;
import org.terracotta.api.TerracottaClient;

public class Server {
	private static final int port = 9540;
	private static final String server_name = "http://0.0.0.0:" + port;
	public static ClusteringToolkit toolkit = new TerracottaClient("localhost:9510").getToolkit();
	
	public static void main(String[] args) {
		// Check to make sure Java has access to the MD5 codec
		
		try {
			@SuppressWarnings("unused")
			MessageDigest md = MessageDigest.getInstance("MD5");
		} catch (NoSuchAlgorithmException e) {
			System.err.println("Could not find the required MD5 hash codec, must quit");
			System.exit(-1);
		}
		
		Endpoint.publish(server_name + "/chromebot", new ChromeBot());
		Endpoint.publish(server_name + "/crashes", new CrashManager());
		Endpoint.publish(server_name + "/workqueue", new WorkPacketManager());	
		
	}
}
